Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-3832 ZKHostnameVerifier rejects valid certificates with subjectAltNames #1353

Closed
wants to merge 3 commits into from

Conversation

anmolnar
Copy link
Contributor

@anmolnar anmolnar commented May 18, 2020

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

@anmolnar anmolnar self-assigned this May 18, 2020
@anmolnar anmolnar requested review from nkalmar and symat May 18, 2020 18:19
Copy link
Contributor

@symat symat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, +1
I had one question about ASN.1 DER, please take a look

if (o instanceof String) {
result.add(new SubjectName((String) o, type));
} else if (o instanceof byte[]) {
// TODO ASN.1 DER encoded form
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what ASN.1 DER is or how commonly it is used, but I think at least printing out a warning here would make sense (informing the user that ASN.1 DER is not supported). (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it can be done with BouncyCastle ASN1 libraries, but this part was missing in the original patch too. I'd be happy to add it as a separate ticket, but first I need an example certificate with ASN1 encoded data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Mate here, probably adding a warning until this TODO is not implemented would be nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a static method. How can I log here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't see it's a static method. But I believe you can log by making the logger also static. Not sure it is worth it though, it's not a stopper from my side if we leave the TODO, just a nice-to-have.

@anmolnar anmolnar requested review from eolivelli and symat May 20, 2020 10:50
@anmolnar
Copy link
Contributor Author

retest maven build

2 similar comments
@anmolnar
Copy link
Contributor Author

retest maven build

@anmolnar
Copy link
Contributor Author

retest maven build

@anmolnar
Copy link
Contributor Author

@eolivelli @nkalmar @symat Maven build is green now. Would you like me to add some logging before submitting?

@symat
Copy link
Contributor

symat commented May 21, 2020

I think you can push it as it is. Nice change!

@eolivelli
Copy link
Contributor

Merging it now

@eolivelli eolivelli closed this in 5820d10 May 21, 2020
eolivelli pushed a commit that referenced this pull request May 21, 2020
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes #1353 from anmolnar/ZOOKEEPER-3832

(cherry picked from commit 5820d10)
Signed-off-by: Enrico Olivelli <eolivelli@apache.org>
@anmolnar
Copy link
Contributor Author

anmolnar commented May 21, 2020

Thanks @eolivelli

@eolivelli
Copy link
Contributor

I have written in JIRA.
Committed to master and 3.6.
It does not apply to 3.5 cleanly

@anmolnar
Copy link
Contributor Author

I'll create separate PR.

anmolnar added a commit to anmolnar/zookeeper that referenced this pull request May 21, 2020
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832
Copy link
Contributor

@nkalmar nkalmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@nkalmar
Copy link
Contributor

nkalmar commented May 21, 2020

NVM, it's already committed :)

@anmolnar anmolnar deleted the ZOOKEEPER-3832 branch July 23, 2020 16:10
stickyhipp pushed a commit to stickyhipp/zookeeper that referenced this pull request Aug 19, 2020
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Sep 3, 2022
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832
anmolnar added a commit to anmolnar/zookeeper that referenced this pull request May 21, 2024
…bjectAltNames

This issue has been reported by a user who wanted to use a cert that contains SAN entries that are not of type DNS or IP.
I've come across the following ticket in http client project which seems to be related:
https://issues.apache.org/jira/browse/HTTPCLIENT-1906

This is the backport of the fix.

Original patch: apache/httpcomponents-client@56cc245

Target versions: 3.5, 3.6, 3.7

Author: Andor Molnar <andor@apache.org>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Mate Szalay-Beko <symat@apache.org>

Closes apache#1353 from anmolnar/ZOOKEEPER-3832

Change-Id: I5d3c0d66010942a252cb9f5cd08fa50eadd5925f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants